package com.test.shiyan4;

import java.util.Scanner;

public class QW {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (true){
            System.out.print("请输入井深n米：");
            int n = sc.nextInt();
            double sum =0,up = 6,down = 0;
            for (int i =0;sum<n;i++){
                sum +=up;
                if (sum>=n){
                    System.out.println("青蛙王子"+(i+1)+"天可以跳出来");
                    break;
                }
                down=5*Math.pow(0.5,i);
                sum-=down;
                System.out.println(i + 1+": "+up+"-"+down+"="+sum);
            }
        }
    }
}
